﻿using System.ComponentModel;
using System.Runtime.Serialization;

namespace SlamDunk.ValueObjects.Enums
{
    /// <summary>
    /// 串口奇偶校验位
    /// </summary>
    [DataContract]
    public enum Parity
    {
        /// <summary>
        /// 不发生奇偶校验检查
        /// </summary>
        [EnumMember]
        [Description("不发生奇偶校验检查")]
        None = 0,

        /// <summary>
        /// 设置奇偶校验位，使位数等于奇数
        /// </summary>
        [EnumMember]
        [Description("设置奇偶校验位，使位数等于奇数")]
        Odd = 1,

        /// <summary>
        /// 设置奇偶校验位，使位数等于偶数
        /// </summary>
        [EnumMember]
        [Description("设置奇偶校验位，使位数等于偶数")]
        Even = 2,

        /// <summary>
        /// 将奇偶校验位保留为 1
        /// </summary>
        [EnumMember]
        [Description("将奇偶校验位保留为 1")]
        Mark = 3,

        /// <summary>
        /// 将奇偶校验位保留为 0
        /// </summary>
        [EnumMember]
        [Description("将奇偶校验位保留为 0")]
        Space = 4
    }
}
